package com.dotflat.rest.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
//import com.matt.commons.model.Domain;
import com.starinside.wp.domain.Domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;

/**
 * 园区数据
 */
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@MappedSuperclass
public class AreableObjectBase extends Domain {

    @Column(columnDefinition = "varchar(32)  COMMENT '创建人'")
    @ApiModelProperty("创建人")
    private String createdBy;

    @Column(columnDefinition = "varchar(32)  COMMENT '园区ID'")
    @JsonIgnore
    private String areaId;

//    @Column(columnDefinition = "datetime default NOW() COMMENT '事件发生时间'", nullable = true)
//    private Date eventTime = new Date();

    @Column(columnDefinition = " int(3) DEFAULT 0 COMMENT '审核状态 0.待审核  1.审核通过  2.审核拒绝' ", nullable = false)
    @ApiModelProperty("审核状态 0.待审核  1.审核通过  2.审核拒绝' ")
    private Integer audited = 0;

    @JsonIgnore
    @ApiModelProperty(hidden = true)
    public boolean isOwnerOnly(){
        return false;
    }
}
